package com.itheima.controller;

import com.itheima.common.R;
import com.itheima.pojo.Combo;
import com.itheima.pojo.Food;
import com.itheima.service.FoodPainsService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;

/**
 * @author 林晓伟
 */
@RestController
@RequestMapping("/setmeal")
public class FoodPainsController {
    @Resource
    private FoodPainsService foodPainsService;

    /**
     * F14-菜品详情
     *
     * @param id 菜品id
     */
    @GetMapping("/dish/{id}")
    public R a(@PathVariable String id) {
        List<Food> a = foodPainsService.a(id);
        return R.success(a);
    }

    /**
     * F15-套餐列表
     *
     * @param categoryId F15-套餐列表
     * @param status     状态
     */
    @GetMapping("/list")
    public R b(@RequestParam String categoryId, Integer status) {
        List<Combo> b = foodPainsService.b(categoryId, status);
        return R.success(b);
    }
}
